﻿@inherits Isha.Web.Mvc.IshaViewPage          
@{
    string url = string.Empty;       
}
<div id="portal-breadcrumbs">
    <span id="breadcrumbs-you-are-here">You are here:</span><span id="breadcrumbs-home">
        <a href="@Url.Content("~/")">Home</a></span>
    @if (IshaContext.Current.Command != Isha.Extensions.Commands.Create)
    {
        if (!IshaContext.Current.ContentItem.IsHome)
        {
            for (int i = 0; i < IshaModel.Breadcrumbs.Count; i++)
            {
                if (IshaModel.Breadcrumbs.Count >= 1)
                {
                    <span>> </span>
                }

                if (i == IshaModel.Breadcrumbs.Count-1)
                {                   
                    <text>@IshaModel.Breadcrumbs[i].Title</text>
                }
                else
                {
                    url = url + "/" + IshaModel.Breadcrumbs[i].Link;
                    <a href="@url">@IshaModel.Breadcrumbs[i].Title</a>
                }

            }
        }
    }
    else
    {
        foreach (var item in IshaModel.Breadcrumbs)
        {
            if (IshaModel.Breadcrumbs.Count >= 1)
            {
            <span>> </span>
            }

            url = url + "/" + item.Link;
        <a href="@url">@item.Title</a>
        }             
        <span>> </span><text>[...]</text>
    }
</div>
